﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// 开始主面板
/// </summary>
public class StartPanel : BasePanel
{
    static readonly string path = "Perfabs/UI/Panel/StartPanel";
    public StartPanel():base(new UIType(path)) { }

    public override void OnEnter()
    {
        UITool.GetOrAddComponentInChildren<Button>("PeopleButton").onClick.AddListener(() =>
        {
            PanelManager.Push(new PeoplePanel());
        });
        UITool.GetOrAddComponentInChildren<Button>("StartButton").onClick.AddListener(() =>
        {
            GameRoot.Instance.SceneSystem.SetScene(new MainScene());
        });
        UITool.GetOrAddComponentInChildren<Button>("ExitButton").onClick.AddListener(() =>
        {
            Application.Quit();
        });
    }

}
